#include<iostream>
#include<string>

using namespace std;

void test1()
{
	string s1("hello world");
	s1.append("sssss");
	cout << s1 << endl;
	s1.assign("bbbbb");
	cout << s1 << endl;
	s1.insert(0, "hello");
	cout << s1 << endl;
	s1.insert(5, "world");
	cout << s1 << endl;
	s1.insert(0, 10, 'x');
	cout << s1 << endl;
	s1.insert(s1.begin() + 5, 10, 'y');
	cout << s1 << endl;
}

void test2()
{
	string s1("hello world");
	s1.erase(5, 1);
	cout << s1 << endl;
	s1.erase(5);
	cout << s1 << endl;
}

void test3()
{
	string s1("hello world");
	s1.erase(0, 1);
	cout << s1 << endl;
	s1.erase(s1.begin());
	cout << s1 << endl;
}

void test4()
{
	string s1("hello world");
	s1.replace(6, 5, "xxxxxxx");
	cout << s1 << endl;
	string s2("hello world hello bit");
	string s3;
	for (auto ch : s2)
	{
		if (ch != ' ')
		{
			s3 += ch;
		}
		else
		{
			s3 += "20%";
		}
	}
	cout << s3 << endl;
}

void test5()
{
	string url = "https://www.maysheeo.top/blog";
	size_t pos1 = url.find("://");
	string protocol;
	if (pos1 != string::npos)
	{
		protocol = url.substr(0, pos1);
	}
	cout << protocol << endl;
	string domain;
	string uri;
	size_t pos2 = url.find('/', pos1 + 3);
	if (pos2 != string::npos)
	{
		domain = url.substr(pos1 + 3, pos2 - (pos1 + 3));
		uri = url.substr(pos2 + 1);
	}
	cout << domain << endl;
	cout << uri << endl;

}

int main()
{
	test5();
	return 0;
}